package light.head.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import light.head.framework.entity.ExcelField;

import org.hibernate.annotations.Formula;
/**
 * 工作计划
 *
 */
@Entity
@Table
public class Workplan implements Serializable{
	
	
	private static final long serialVersionUID = 7532070668259810619L;
	
	
	private Integer code;
	@ExcelField(order = 3, name = "计划名称")
	private String name;				//计划名称
	@ExcelField(order = 4, name = "本月计划")
	private String monthplan;			//本月计划
	@ExcelField(order = 5, name = "本周完成")
	private String complete;			//本周完成
	@ExcelField(order = 6, name = "下周计划")
	private String nwplan;				//下周计划
	@ExcelField(order = 7, name = "商品名称")
	private String remark;				//备注
	private Integer cu;					//创建人
	private Integer oc;					//创建机构
	private Date ct;
	private Boolean deleted;
	
	@ExcelField(order = 1, name = "创建人")
	private String cn;
	@ExcelField(order = 2, name = "创建机构")
	private String on;
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public String getName() {
		return name;
	}
	@Column
	public String getMonthplan() {
		return monthplan;
	}
	@Column
	public String getComplete() {
		return complete;
	}
	@Column
	public String getNwplan() {
		return nwplan;
	}
	@Column
	public String getRemark() {
		return remark;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getCt() {
		return ct;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = cu )")
	public String getCn() {
		return cn;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code = oc)")
	public String getOn() {
		return on;
	}
	
	
	
	
	
	
	
	
	
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setMonthplan(String monthplan) {
		this.monthplan = monthplan;
	}
	public void setComplete(String complete) {
		this.complete = complete;
	}
	public void setNwplan(String nwplan) {
		this.nwplan = nwplan;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setCn(String cn) {
		this.cn = cn;
	}
	public void setOn(String on) {
		this.on = on;
	}
	
	

}
